package com.zhuss.core.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.core.config.type.DetailConfigTypeBo;
import com.zhuss.bean.bo.core.config.type.SearchConfigTypeBo;
import com.zhuss.common.ListConfigTypeBo;
import com.zhuss.common.ReadService;
import com.zhuss.core.processor.ConfigTypeRead;
import com.zhuss.exception.AabException;


/**
 * 配置类型查询service（基本查询）
 * @author zhushanshuo
 * @Date 2020-02-20 11:58
 *
 */
@Component("configTypeReadService")
public class ConfigTypeReadService implements ReadService<Object, Object> {
	
	@Autowired
	@Qualifier("configTypeRead")
	private ConfigTypeRead configTypeRead;
	
	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws AabException {
		DetailConfigTypeBo bo = (DetailConfigTypeBo) param;
		Long configTypeId = bo.getConfigTypeId();
		Object vo = configTypeRead.detail(configTypeId);
		return vo;
	}
	
	/**
	 * 列表
	 */
	@Override
	public Object list(Object param) {
		SearchConfigTypeBo bo = (SearchConfigTypeBo) param;
		Object result = configTypeRead.list(bo);
		return result;
	}
	
	
	/**
	 * 配置类型下拉
	 */
	public Object configTypeList(Object param) throws AabException {
		ListConfigTypeBo bo = (ListConfigTypeBo) param;
		
		String typeGroup = bo.getTypeGroup();
		Object result = configTypeRead.configTypeList(typeGroup);
		return result;
	}
	
}

